package com.oracle.listener;

import com.oracle.Service.impl.CategoryService;
import com.oracle.mapper.CategoryMapper;
import com.oracle.pojo.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.ContextLoaderListener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
import java.util.List;

@WebListener
public class InitListener implements ServletContextListener {



    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        ServletContext sc = servletContextEvent.getServletContext();
        sc.setAttribute("root", sc.getContextPath());
        sc.setAttribute("css", sc.getContextPath()+"/resource/css");
        sc.setAttribute("js", sc.getContextPath()+"/resource/js");
        sc.setAttribute("images", sc.getContextPath()+"/resource/images");
        sc.setAttribute("kindeditor", sc.getContextPath()+"/resource/kindeditor");
    }

    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {

    }
}
